September 2021

Git Basics

Git is a distributed version control system. It saves all the different versions of files. Git is helpfull when multiple people working on the same project. Every person can have a clone of the project as available on the common server and work on the project.

Git doesn`t save different files instead it thinks of it`s data like a series of snapshots of a miniature filesystem. Even if the server goes down temporarily every client can keep working on the project as a clone of the whole project is available locally and the files can be saved locally and updated later on the server.

While collaborating in teams using Git, it is impssible to make changes to any file or directory without Git knowing about it as everything is checksummed before it is stored. Git will be able to detect any loss of information or file corruption.

The basic Git workflow works like this -

1. You modify the files in your working tree.

2. You stage the changes you want to be the part of your next commit, which adds these changes to the staging area.

3. You do a commit, which takes the files from the staging area and stores them to your Git directory.